package org.zhadoop.stream.api.streams;

import java.io.Serializable;

import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamOmitField;

/**
 * 列信息
 * @author zwd
 *
 */
public class Column implements Serializable{

	private static final long serialVersionUID = 8394617895729317229L;
	
	/**
	 * 列名称
	 */
	@XStreamAsAttribute
	private String name;
	
	/**
	 * 列别名
	 */
	@XStreamAsAttribute
	@XStreamOmitField
	private String alias;
	
	/**
	 * 列类型
	 * 这个是class名称
	 * 比如：java.lang.String
	 */
	@XStreamAsAttribute
	private String type;

	/**
	 * 构造函数
	 */
	public Column(String name,Class<?> type) {
		this.name = name;
		if(type != null){
			this.type = type.getName();
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
}
